package com.flower.subject.enums;

import lombok.Getter;

/**
 * @author lavender
 * @version 1.0
 * @date 2024-07-03 12:01
 * 分类类型枚举
 */
@Getter
public enum SubjectInfoTypeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答");

    private Integer code;
    private String message;

    SubjectInfoTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public static SubjectInfoTypeEnum getByCode(Integer code) {
        for (SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()) {
            if (resultCodeEnum.getCode().equals(code)) {
                return resultCodeEnum;
            }
        }
        return null;
    }
}
